<?php

session_start();

?>
<form method="post" action="">
  Task summary <input name="summary" /> <input type="submit" value="Add" />
</form>
<?php

$task = $_POST['summary'];
if ($task) {
  $_SESSION['tasks'][] = $task;
}

$remove = $_GET['remove'];
if (array_key_exists($remove, (array) $_SESSION['tasks']))
  unset($_SESSION['tasks'][$remove]);

if (is_array($_SESSION['tasks']))
  foreach ($_SESSION['tasks'] as $id => $task)
    echo '<li>',$task,' <a href="?remove=',$id,'">x</a></li>';

?>